<?php

class Admin_Backup_CreateAction extends BlogAdminBaseAction
{
    /**
     * Process HTTP GET request. Perform a backup.
     *
     * @param AgaviRequestDataHolder $rd
     */
    public function executeRead(AgaviRequestDataHolder $rd)
    {
        /* @var $backups_model Admin_BackupsModel */
        $backups_model = $this->getContext()->getModel('Backups', 'Admin');
        
        $backups_model->checkBackupsSubsystem();
        $backup_file = $backups_model->doBackupAll();
        
        $this->setAttribute('backup_file', $backup_file);
        
        return 'Success';
    }
    
	/**
	 * Returns the default view if the action does not serve the request
	 * method used.
	 *
	 * @return     mixed <ul>
	 *                     <li>A string containing the view name associated
	 *                     with this action; or</li>
	 *                     <li>An array with two indices: the parent module
	 *                     of the view to be executed and the view to be
	 *                     executed.</li>
	 *                   </ul>
	 */
	public function getDefaultViewName()
	{
		return 'Success';
	}
}

?>